home *** CD-ROM | disk | FTP | other *** search
/ Windows Expert / Windows Expert.iso / windownt / sossnt.zip / SOSSNT / RPC / SOCK.H < prev    next >
C/C++ Source or Header  |  1993-03-06  |  1KB  |  49 lines

  1. /*
  2.  *  sock.h --
  3.  *      High level socket interface for PC NFS file server.
  4.  *
  5.  *  Author:
  6.  *      See-Mong Tan
  7.  */
  8.  
  9. #include <stdio.h>
  10. #include <stdlib.h>
  11. #include <malloc.h>
  12. #include <types.h>
  13. #include <task.h>
  14. #include <q.h>
  15. #include <netq.h>
  16. #include <net.h>
  17. #include <custom.h>
  18. #include <netbuf.h>
  19. #include <icmp.h>
  20. #include <ip.h>
  21. #include <udp.h>
  22. #include <tftp.h>
  23. #include <timer.h>
  24. #include <em.h>
  25. #define       SOCK_STREAM     1               /* stream socket */
  26. #define       SOCK_DGRAM      2               /* datagram socket */
  27. #define  AF_INET         2               /* internetwork: UDP, TCP, etc. */
  28. #define       IPPROTO_UDP             17          /* user datagram protocol */
  29. #define       IPPROTO_TCP             6               /* tcp */
  30.  
  31.  
  32.  
  33. /* exported functions */
  34.  
  35.   /* creates socket - combination of 4 BSD "socket" and "bind" calls */
  36. extern int sock_create(int, int, struct sockaddr_in *);
  37.   /* closes socket - 4 BSD "close" */
  38. extern void sock_close(int);
  39.   /* receive - 4 BSD "recvfom" */
  40. extern int sock_recv(int, char *, int, struct sockaddr_in *);
  41.   /* synchronous I/O multiplexing - 4 BSD "select" */
  42. extern int sock_select(long *, long *);
  43.   /* UDP message send */
  44. extern int sock_send(int, struct sockaddr_in *, char *, int);
  45.   /* returns host name given internet address */
  46. extern char *sock_gethostbyaddr(struct sockaddr_in);
  47.   /* returns host address given host name */
  48. extern long sock_gethostbyname(char *);
  49.